﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using OTS.BLL;

public partial class OLPC_MCToDeliveryApproval : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["dtlist"] = null;
            InitUi();
        }
    }
    // 初始化绑定
    private void InitUi()
    {
        CommonMethod.IsTimeOutUserCode(this);
        InitDataBind();
    }
    // 已有数据
    private void InitDataBind()
    {
        DataTable tempdt = new DataTable();
        if (Session["dtlist"] != null)
        {
            tempdt = Session["dtlist"] as DataTable;
        }
        else
        {
            tempdt = AccountStatementItemBLL.GetList("");
            gv.DataSource = tempdt;
            gv.DataBind();
        }
        gv.DataSource = tempdt;
        gv.DataBind();
        Session["dtlist"] = tempdt;
    }
    protected void gv_AfterPerformCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewAfterPerformCallbackEventArgs e)
    {
        InitDataBind();
    }
}